package view.user;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import controller.ActionEvents.ActionHandler;

import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.JList;
import javax.swing.ImageIcon;

/** 
 * @author Christian
 * Displays the UI transfer window.
 */
public class Transfer extends JPanel {
	
	/** Declares swing components as variables*/
	private JLabel lblTransfer;
	
	/** Declares objects of classes*/
	private ActionHandler actionHandler;
	private JTextField txtTransferToID;
	private JLabel lblTransferID;
	private JButton btnSearch;
	private JComboBox comboBox;
	private JButton btnSubmit;
	private JTextField transferAmount;
	private JLabel lblAmount;
	private JLabel lblTransferFromAccount;
	private JComboBox comboBoxFromAcc;
	private JTextField txtTransactionNote;
	private JLabel lblTransactionNote;

	/**
	 * Constructor creates the panel, and swing components.
	 */
	public Transfer(ActionHandler actionHandler) {
		this.actionHandler = actionHandler;
		
		setLayout(null);
		setPreferredSize(new Dimension(750, 372));
		setBackground(Color.WHITE);
		
		lblTransfer = new JLabel("Transfer");
		lblTransfer.setFont(new Font("Euphemia UCAS", Font.PLAIN, 28));
		lblTransfer.setBounds(321, 6, 163, 39);
		add(lblTransfer);
		
		txtTransferToID = new JTextField();
		txtTransferToID.setBounds(280, 209, 218, 28);
		txtTransferToID.setBackground(Color.decode("#f1f1f1"));
		add(txtTransferToID);
		txtTransferToID.setColumns(10);
		
		lblTransferID = new JLabel("Transfer to ID:");
		lblTransferID.setBounds(162, 215, 106, 16);
		add(lblTransferID);
		
		btnSearch = new JButton("");
		btnSearch.setIcon(new ImageIcon(Transfer.class.getResource("/Pictures/green/search.png")));
		btnSearch.setBounds(498, 209, 48, 39);
		btnSearch.addActionListener(actionHandler);
		btnSearch.setActionCommand("transferSEARCH");
		btnSearch.setBorderPainted(false);
		btnSearch.setContentAreaFilled(false);
		add(btnSearch);
		
		comboBox = new JComboBox();
		comboBox.setBounds(280, 249, 218, 27);
		add(comboBox);
		
		btnSubmit = new JButton("");
		btnSubmit.setBounds(503, 306, 117, 29);
		btnSubmit.addActionListener(actionHandler);
		btnSubmit.setActionCommand("transferSUBMIT");
		btnSubmit.setBorderPainted(false);
		btnSubmit.setContentAreaFilled(false);
		add(btnSubmit);
		
		transferAmount = new JTextField();
		transferAmount.setBounds(280, 169, 218, 28);
		transferAmount.setBackground(Color.decode("#f1f1f1"));
		add(transferAmount);
		transferAmount.setColumns(10);
		
		lblAmount = new JLabel("Amount:");
		lblAmount.setBounds(194, 175, 74, 16);
		add(lblAmount);
		
		lblTransferFromAccount = new JLabel("Transfer from Account:");
		lblTransferFromAccount.setBounds(110, 135, 158, 16);
		add(lblTransferFromAccount);
		
		comboBoxFromAcc = new JComboBox();
		comboBoxFromAcc.setToolTipText("");
		comboBoxFromAcc.setBounds(280, 130, 218, 27);
		add(comboBoxFromAcc);
		
		txtTransactionNote = new JTextField();
		txtTransactionNote.setBounds(280, 283, 218, 21);
		add(txtTransactionNote);
		txtTransactionNote.setColumns(10);
		
		lblTransactionNote = new JLabel("Make a short comment:");
		lblTransactionNote.setBounds(110, 286, 158, 16);
		add(lblTransactionNote);
		
	
	
	}

	/**
	 * @return the txtTransactionNote
	 */
	public JTextField getTxtTransactionNote() {
		return txtTransactionNote;
	}

	/**
	 * @param txtTransactionNote the txtTransactionNote to set
	 */
	public void setTxtTransactionNote(JTextField txtTransactionNote) {
		this.txtTransactionNote = txtTransactionNote;
	}

	/**
	 * @return the comboBox
	 */
	public JComboBox getComboBox() {
		return comboBox;
	}

	/**
	 * @param comboBox the comboBox to set
	 */
	public void setComboBox(JComboBox comboBox) {
		this.comboBox = comboBox;
	}

	/**
	 * @return the txtTransferToID
	 */
	public JTextField getTxtTransferToID() {
		return txtTransferToID;
	}

	/**
	 * @return the btnSearch
	 */
	public JButton getBtnSearch() {
		return btnSearch;
	}

	/**
	 * @return the btnSubmit
	 */
	public JButton getBtnSubmit() {
		return btnSubmit;
	}

	/**
	 * @return the transferAmount
	 */
	public JTextField getTransferAmount() {
		return transferAmount;
	}

	/**
	 * @return the comboBoxFromAcc
	 */
	public JComboBox getComboBoxFromAcc() {
		return comboBoxFromAcc;
	}

	/**
	 * @param comboBoxFromAcc the comboBoxFromAcc to set
	 */
	public void setComboBoxFromAcc(JComboBox comboBoxFromAcc) {
		this.comboBoxFromAcc = comboBoxFromAcc;
	}
} // End Class Transfer.java
